<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomMain"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.action.DengjibiaoAction"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
		String riqi = (String)request.getAttribute("riqi");

		SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
		
		Calendar calendar = Calendar.getInstance();
	    calendar.setFirstDayOfWeek(Calendar.MONDAY);
		if(riqi!=null && !"".equals(riqi)){
			calendar.setTime(sdf1.parse(riqi));
		}else{
			riqi = sdf1.format(calendar.getTime());
		}
		List huiyiList = (List)request.getAttribute("huiyiList");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<link rel="stylesheet" type="text/css" href="<%=basePath %>ext-2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="<%=basePath %>ext-2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=basePath %>ext-2.1/ext-all.js"></script>
<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css"/>


<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>粮油集团协同办公平台</title>
<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>

<script type="text/javascript">
	function isTrueDate(time){
	    document.getElementById('riqistr').value = time;
	    MeetingRoomEmployBo.isTrueDate(time,isTrueDateAfter);
	}
				
	function initWH(){
    	//document.getElementById('indexDiv').style.height = document.body.clientHeight+"px";
   	}
   	
   	window.onload = function(){
   		initWH();
		var tb = new Ext.Toolbar(
			{
				height:25
			}
		);
	
	    tb.render('menu');
		tb.addFill();
	    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">会议申请</a>&nbsp;&nbsp;&nbsp;');
	}
</script>
</head>
<body>
<div id="right" style="height:640px;">
<div style="height:100%;">
	  <div id="menu" style="padding-top:4px;"></div>
      <form name="form1" method="post" id="form1">
      <div style="background-color: white;" id="indexDiv" style="height:620px;">
		<table>
			<tr>
			<td style="background-color: #C8C7C7;width: 40px;">&nbsp;</td>
			<td>已过期，不能申请&nbsp;&nbsp;&nbsp;</td>
			<td style="background-color: #C8FADB;width: 40px;">&nbsp;</td>
			<td>无预定，可申请&nbsp;&nbsp;&nbsp;</td>
			<td style="background-color: yellow;width: 40px;">&nbsp;</td>
			<td>有部门预订，但还未审批，可申请&nbsp;&nbsp;&nbsp;</td>
			<td style="background-color: red;width: 40px;">&nbsp;</td>
			<td>有部门预订，已通过审批，不可申请&nbsp;&nbsp;&nbsp;</td>
			</tr>
		</table>
		<div >
		
	      <table border="1" cellspacing="0" cellpadding="0" style="text-align: center; margin:0px auto;">
	      	<tr style="height: 50px">
	      		<td colspan="6" align="center">会议室登记表</td>
	      		<td>
		      		<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=shenqingdengjibiao&riqi=<%=riqi %>&order=top">上周</a>&nbsp;
		      		<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=shenqingdengjibiao&riqi=<%=riqi %>&order=top"><==</a>
	      		</td>
	      		<td>
		      		<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=shenqingdengjibiao&riqi=<%=riqi %>&order=down">==></a>&nbsp;
		      		<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=shenqingdengjibiao&riqi=<%=riqi %>&order=down">下周</a>
	      		</td>
	      	</tr>
	      	<tr>
	      		<td rowspan="2" style="width: 120px">日期</td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      		<td width="140px"><%calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);out.print(sdf.format(calendar.getTime()));%></td>
	      	</tr>
	      	<tr style="height: 50px">
	      	<td>星期一</td><td>星期二</td><td>星期三</td><td>星期四</td><td>星期五</td><td>星期六</td><td>星期日</td>
	      	</tr>
	      	<%
	      	for (Iterator iterator = huiyiList.iterator(); iterator.hasNext();) {
	      		MeetingRoomMain room = (MeetingRoomMain) iterator.next();
			%>
			<tr style="height: 50px">
				<td><%=room.getMeetingroomName() %><br/><%=room.getPeopleNumbert() %>人&nbsp;<%=room.getPlace() %></td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouyishang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td>
						<%
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouyixia(),"下午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouershang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td>
						<%
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouerxia(),"下午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhousanshang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td><%out.print(DengjibiaoAction.returnState(basePath,room.getZhousanxia(),"下午",sdf1.format(calendar.getTime()),room.getId()));%></td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhousishang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td><%out.print(DengjibiaoAction.returnState(basePath,room.getZhousixia(),"下午",sdf1.format(calendar.getTime()),room.getId()));%></td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouwushang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td><%out.print(DengjibiaoAction.returnState(basePath,room.getZhouwuxia(),"下午",sdf1.format(calendar.getTime()),room.getId()));%></td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhouliushang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td><%out.print(DengjibiaoAction.returnState(basePath,room.getZhouliuxia(),"下午",sdf1.format(calendar.getTime()),room.getId()));%></td></tr>
					</table>
				</td>
				<td>
					<table width="100%">
						<tr><td>
						<%
							calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
							out.print(DengjibiaoAction.returnState(basePath,room.getZhourishang(),"上午",sdf1.format(calendar.getTime()),room.getId()));
						%>
						</td></tr>
						<tr><td><%out.print(DengjibiaoAction.returnState(basePath,room.getZhourixia(),"下午",sdf1.format(calendar.getTime()),room.getId()));%></td></tr>
					</table>
				</td>
			</tr>
			<%
	      	}
	      	%>
	      </table>
	      </div>
      </div>
      </form>
</div>
</div>
</body>  
 
</html>
